Add a help overlay to bloatpad
authorMatthias Clasen <mclasen@redhat.com>
Sun, 17 Apr 2016 14:22:59 +0000 (10:22 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 17 Apr 2016 17:42:14 +0000 (13:42 -0400)
This will let us explore the (non-)interaction between
help overlays and editing shortcuts.

examples/bp/Makefile.am
examples/bp/bloatpad.gresources.xml
examples/bp/gtk/help-overlay.ui [new file with mode: 0644]
examples/bp/gtk/menus.ui

index 69305210028d02bdbc96777e6030ff5ade23cf61..d521715eae0657a6e1611a7ad19e68e93b9ee0cd 100644 (file)
@@ -19,7 +19,8 @@ nodist_bloatpad_SOURCES = bloatpad-gresources.c
 
 resource_files = \
        bloatpad.gresources.xml         \
-       gtk/menus.ui
+       gtk/menus.ui                    \
+       gtk/help-overlay.ui
 
 bloatpad-gresources.c: $(resource_files)
        $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $<
index 2e5c42314b09193b9750647af6bb231cd1228c2d..04650a721243fae594a0bb2d063ea667deb1e881 100644 (file)
@@ -3,5 +3,6 @@
 <gresources>
   <gresource prefix="/org/gtk/bloatpad">
     <file preprocess="xml-stripblanks">gtk/menus.ui</file>
+    <file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
   </gresource>
 </gresources>
diff --git a/examples/bp/gtk/help-overlay.ui b/examples/bp/gtk/help-overlay.ui
new file mode 100644 (file)
index 0000000..ac166b7
--- /dev/null
@@ -0,0 +1,47 @@
+<interface>
+  <!-- interface-requires gtk+ 3.17 -->
+  <object class="GtkShortcutsWindow" id="help_overlay">
+    <property name="modal">1</property>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <property name="section-name">shortcuts</property>
+        <property name="max-height">12</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title">Shortcuts</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;c</property>
+                <property name="title" translatable="yes">Copy</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;p</property>
+                <property name="title" translatable="yes">Paste</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">F11</property>
+                <property name="title" translatable="yes">Fullscreen</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;q</property>
+                <property name="title" translatable="yes">Quit</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
index 60abf4adb88aaa47c8423cf5a47c7fb520e21e49..d3adad8e4aaba0b9496b1bd65ea819d38c874bc2 100644 (file)
           <attribute name='action'>app.edit-accels</attribute>
         </item>
       </section>
+      <section>
+        <item>
+          <attribute name='label' translatable='yes'>Shortcuts...</attribute>
+          <attribute name='action'>win.show-help-overlay</attribute>
+        </item>
+      </section>
     </submenu>
     <submenu>
       <attribute name='label' translatable='yes'>_View</attribute>